
    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      
    </div>

    <div class="container">
      <!-- Example row of columns -->
      <div class="row">
        	<div class="list-group" id="list">
        		<?php foreach ($db as $k => $v) { ?>
				    <div class="list-group-item">
				        <h4 class="list-group-item-heading">
				            <?php echo $v['username'] ?>(<?php echo date('Y-m-d H:i:s',$v['create_time']) ?>)
				        </h4>
				        <p class="list-group-item-text">
				            <?php echo $v['content'] ?>
				        </p>
				        <p class="list-group-item-text" >
				           <a href="./del.php?id=<?php echo $k ?>" class="btn btn-danger" onclick="if(confirm('确定删除吗')==false){return false;}">删除</a>
				        	<a href="./edit.php?id=<?php echo $k ?>" class="btn btn-primary">修改</a> 
				        </p>
				        
				    </div>
			    <?php } ?>
			</div>
			<button id="more" class="btn btn-primary btn-lg btn-block">加载更多</button>
			<style type="text/css">
				.col-md-12{
					padding:0px;
					margin-top: 10px;
				}
			</style>
			<form action="./add.php" method="post" class="form-inline col-md-12" role="form">
			  <div class="col-md-12">
				  	<div class="form-group">
				    <label class="sr-only" for="exampleInputEmail2">用户名</label>
				    <input type="text" class="form-control" id="exampleInputEmail2" disabled=""placeholder="用户名" name="username" value="<?php if(isset($_SESSION['username'])){echo $_SESSION['username'];} ?>">
            <input type="hidden" class="form-control" id="exampleInputEmail2" placeholder="用户名" name="username" value="<?php if(isset($_SESSION['username'])){echo $_SESSION['username'];} ?>">
				  </div>
				  <button type="submit" class="btn btn-success">留言</button>
			  </div>
			  <textarea name="content" style="width:100%" class="form-control col-md-12" rows="3"></textarea>
			</form>
        
      </div>

      <hr>

      <footer>
        <p>&copy; Company 2014</p>
      </footer>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="./Tpl/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->

    <script type="text/javascript">
	    $(function  () {
	    	page=1;
	    	$('#more').click(function(event) {

	    		page++;
	    		$.ajax({
	    			url: './ajax.php',
	    			type: 'POST',
	    			dataType: 'html',
	    			data: {p:page},
	    		})
	    		.done(function(data) {
	    			// alert(data);
	    			$('#list').append(data);
	    		})
	    		.fail(function(data) {
	    			console.log("error");
	    		})
	    	});
	    })
    </script>
  </body>
</html>
